<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <wicket:extend>

        <script>
            window.onload = function() {
            };
                 
            $(document).ready(function(){                
            });
        
            $(function(){ 
                
                //determine editing
                var isEdditing = $("#isEditing")[0].getAttribute("value");
                if (isEdditing === "1")
                    showEditTool();
            });
                    
            function showEditTool() { $("#editformdiv").show("slow"); $("#showeditdiv").hide(); };
        </script>

        <div class="post">
            <h2><wicket:message key="header">Aircrafts</wicket:message></h2>

            <p wicket:id="info">Prihlaste se</p>
            <a wicket:id="showForm" id="showeditdiv" onclick="showEditTool()"><img class="ico" src="Images/add.png"/></a>

            <div wicket:id="feedback">[[ feedback ]]</div>
            <div class="addItem" id="editformdiv" style="display: none">
                <form wicket:id="form" action="#" class="editform"> 
                    <fieldset>
                        <legend><h4><span wicket:id="heading">Form Name</span></h4></legend>
                        
                        <input type="text" id="isEditing" wicket:id="isEdditing" hidden="true">  

                        <table>
                            <tr><td><label><wicket:message key="newCode"></wicket:message></label>:</td><td><input type="text" size="15" wicket:id="codeForm"/></td></tr>
                            <tr><td><label><wicket:message key="newCapacity"></wicket:message></label>:</td><td><input type="text" size="15" wicket:id="capacityForm"/></td></tr>
                            <tr><td><label><wicket:message key="newType"></wicket:message></label>:</td><td><input type="text" size="25" wicket:id="typeForm"/></td></tr>
                            <tr><td></td><td style="width: 250px"><input type="submit" wicket:id="submitButton" wicket:message="value:form.submit">
                                    <input type="submit" wicket:id="cancelButton" wicket:message="value:form.cancel"></td>
                            </tr>
                        </table>
                    </fieldset>
                </form>
            </div>

            <p wicket:id="error"></p>
            <table class="datatable">
                <tr wicket:id="header">
                    <th><wicket:message key="viewId">ID</wicket:message></th>
                <th><wicket:message key="viewCode">Code</wicket:message></th>
                <th><wicket:message key="viewCapacity">Capacity</wicket:message></th>
                <th><wicket:message key="viewType">Type</wicket:message></th>
                </tr>
                <tr wicket:id="repeating">
                    <td><span wicket:id="id">[id]</span></td>
                    <td><span wicket:id="code">[code]</span></td>
                    <td><span wicket:id="capacity">[capacity]</span></td>
                    <td><span wicket:id="type">[type]</span></td>
                    <td><a href="#" wicket:id="delete"><img class="ico" name="delete" src="Images/delete.png"/></a></td>
                    <td><a href="#" wicket:id="edit"><img class="ico" name="edit" onclick="showEditTool()" src="Images/pero.png"/></a></td>
                </tr>
            </table>
        </div>
    </wicket:extend>
</body>
</html>
